import { Module } from '@nestjs/common'
import { TypeOrmModule } from '@nestjs/typeorm'

import { SseService } from '~/modules/sse/sse.service'

import { DeviceEntity } from '../device/device.entity'
import { UserAlarmController } from './userAlarm.controller'
import { UserAlarmEntity } from './userAlarm.entity'
import { UserAlarmService } from './userAlarm.service'
import { UserDataController } from './userData.controller'
import { UserDataEntity } from './userData.entity'
import { UserDataService } from './userData.service'
import { UserSosController } from './userSos.controller'
import { UserSosEntity } from './userSos.entity'
import { UserSosService } from './userSos.service'

const providers = [UserDataService, UserAlarmService, UserSosService, SseService]

@Module({
  imports: [
    TypeOrmModule.forFeature([DeviceEntity, UserDataEntity, UserAlarmEntity, UserSosEntity]),
  ],
  controllers: [UserDataController, UserAlarmController, UserSosController],
  providers: [...providers],
  exports: [TypeOrmModule, ...providers],
})
export class UserModule {}
